package design.mode.effective_java.chapter9.item58;


import java.util.*;

/**
 * @author ZhongMingde on 2021/9/1
 */

public class Test1 {
    // Can you spot the bug?
    enum Suit {CLUB, DIAMOND, HEART, SPADE}

    enum Rank {ACE, DEUCE, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING}

    public static void main(String[] args) {
        List<Suit> suits = Arrays.asList(Suit.values());
        List<Rank> ranks = Arrays.asList(Rank.values());
        List<Card> deck = new ArrayList<>();
        for(Iterator<Suit> i = suits.listIterator(); i.hasNext();){
            for (Iterator<Rank> j = ranks.listIterator(); i.hasNext();){
                deck.add(new Card(i.next(),j.next()));
                System.out.println(i.next() + " " + j.next());
            }
        }
    }

}
